<?php
require_once './libs/base_factory.php';
$g_factory = new full_factory();

// Left content modules ---------------------------------------------------------------------------

$cate_lst_left = new module_category_lst_left($g_factory->base_constants["theme"]["current"] . "/cate_lst_left.tpl");
$ads_left = new module_ads_left($g_factory->base_constants["theme"]["current"] . "/ads_left.tpl");

// Center content modules -------------------------------------------------------------------------

$post_lst_bycate_center = new module_post_lst_bycate_center($g_factory->base_constants["theme"]["current"] . "/post_lst_bycate_center.tpl");

// Right content modules --------------------------------------------------------------------------

$post_lst_right = new module_post_lst_right($g_factory->base_constants["theme"]["current"] . "/post_lst_right.tpl");
$counter_right = new module_counter_right($g_factory->base_constants["theme"]["current"] . "/counter_right.tpl");

// Layouts ----------------------------------------------------------------------------------------

$header = new module_header(module_header::$menu_item["none"], $g_factory->base_constants["theme"]["current"] . "/header.tpl");
$left_content = new module_left_content($g_factory->base_constants["theme"]["current"] . "/left_content.tpl");
$center_content = new module_center_content($g_factory->base_constants["theme"]["current"] . "/center_content.tpl");
$right_content = new module_right_content($g_factory->base_constants["theme"]["current"] . "/right_content.tpl");
$footer = new module_footer($g_factory->base_constants["theme"]["current"] . "/footer.tpl");

$page = new document_page(
    "Cục Thống Kê tỉnh Tây Ninh",
    "Website chính thức của Cục Thống Kê tỉnh Tây Ninh",
    "Cuc Thong Ke Tay Ninh, Thong Ke Tay Ninh, Cuc Thong Ke, Tay Ninh, Thong Ke",
    $g_factory->base_constants["theme"]["current"] . "/html.tpl",
    $g_factory->url["default_css"],
    $g_factory->url["default_js"]
);

// Add modules to layouts, and add layouts to document page ---------------------------------------

$left_content->addLayout($cate_lst_left);
$left_content->addLayout($ads_left);

$center_content->addLayout($post_lst_bycate_center);

$right_content->addLayout($post_lst_right);
$right_content->addLayout($counter_right);

$page->addLayout($header);
$page->addLayout($left_content, true);
$page->addLayout($right_content, true);
$page->addLayout($center_content, true);
$page->addLayout($footer);

// Render page ------------------------------------------------------------------------------------

$page->buildingAllSmartyVars();
$g_factory->render_smarty($page->getTplFile(), $page->getSmartyVars());
?>